package router

import (
	"gitee.com/failurejack/smart-construction/api"
	"github.com/gin-gonic/gin"
)

type UserRouter struct{}

var UserRouterApp = new(UserRouter)

func (u *UserRouter) InitUserRouter(Router *gin.RouterGroup) {
	userRouter := Router.Group("/user")
	{
		userRouter.GET("", api.UserApiApp.GetUser)       // 获取用户
		userRouter.POST("", api.UserApiApp.CreateUser)   // 创建用户
		userRouter.PUT("", api.UserApiApp.UpdateUser)    // 更新用户
		userRouter.DELETE("", api.UserApiApp.DeleteUser) // 删除用户
	}
	{
		userRouter.POST("/login", api.UserApiApp.Login)         // 创建客户
		userRouter.POST("/logout", api.UserApiApp.Logout)       // 创建客户
		userRouter.POST("/register", api.UserApiApp.Register)   // 更新客户
		userRouter.POST("/reset", api.UserApiApp.ResetPassword) // 删除客户
		userRouter.GET("/list", api.UserApiApp.GetUserList)     // 删除客户
	}
}
